using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CWM.Skinn;

/// <summary>
/// BlendShapes表情结构模板
/// </summary>
public class BlendShapesStructTemplate : MonoBehaviour
{
    [SerializeField]
    private List<GameObject> blendShapesList = new List<GameObject>();
    public List<GameObject> BlendShapesList
    {
        get
        {
            if (blendShapesList == null || blendShapesList.Count == 0)
            {
                blendShapesList = new List<GameObject>();
                LoadShapes();
            }

            return blendShapesList;
        }
    }

    public void LoadShapes()
    {
        blendShapesList.Clear();
        var childs = transform.GetAllChildren();
        childs.ForEach((child) =>
        {
            blendShapesList.Add(child.gameObject);
        });
    }
}
